package net.oschina.git.zengzhihao.two;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * 可抢占的优先级调度算法
 * 
 * @author zengzhihao
 */
public class Priority {

	public static List<JCB> priority(List<JCB> jcbs) {
		// 按优先级排序
		Collections.sort(jcbs, new Comparator<JCB>() {
			@Override
			public int compare(JCB o1, JCB o2) {
				return o1.getPriority().compareTo(o2.getPriority());
			}
		});

		return jcbs;
	}

}
